package com.ftg.learn.chapter09.collection;

import java.util.*;

/**
 * 学习一下map
 *
 * @author kangjx
 * @version 1.0
 * @date 2023/8/17 上午10:18
 */
public class LearnMap {



    public static void main(String[] args) {
        new Hashtable();
        // hash结构 k,v k : key 主键 唯一
        Map<String,String> map = new HashMap<>(0);

        map.put("ABCDEa123abc","赵琦");
        map.put("ABCDFB123abc","康加修");

        //hashmap - 先找到数组下标 --  hash(key) 3376707 &  table.length -1  ||  hash(key) 3376707 &  table.length -1

        //tab.length = 4;

        map.put("age","16岁");
        System.out.println(map.containsValue("赵琦"));
        //
//        char c = 0;
//        System.out.println(c);
//        String string1 = null;
//        System.out.println(string1);
        map.put(null,null);

        System.out.println(map.get(null));

        System.out.println(map.size());

        System.out.println(map);
        Map<String,String> map1 = new HashMap<>(2);
        map1.put("name","康加修");
        System.out.println(map.size());
        System.out.println(map);

        map1.remove("name");
        System.out.println(map1);
//        List<Map<String,String>> list = new ArrayList<>();
//        list.add(map);
//        list.add(map1);

        new StringBuffer("abc");

    }

}
